package dev.ece.suit.loader.models.obj;

import java.util.List;

import org.lwjgl.opengl.GL11;

import dev.ece.core.vertex.EBO;
import dev.ece.suit.loader.Face;
import dev.ece.suit.loader.Mesh;
import dev.ece.util.lib.Vector2f;
import dev.ece.util.lib.Vector3f;

public class ObjMesh extends Mesh {

	public ObjMesh(int[] faceIndice, int materialIndex) {
		super(faceIndice, materialIndex);
	}

	protected void fillData(List<ObjFace> faces, List<Vector3f> vertice, List<Vector2f> textureCoords, List<Vector3f> normals) {
		ObjFace face = null;
		for(int i=0; i<this.getFaceIndice().length; i++) {
			face = faces.get(this.getFaceIndice()[i]);
			face.fillData(this, vertice, textureCoords, normals);
		}
	}

	@Override
	protected EBO createRenderEBO(Face[] faces) {
		return null;
	}

	@Override
	protected void render() {
		GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, this.getCount());
	}

}
